/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package View;

import View.Listagem.ListagemUsuario;
import View.Listagem.ListagemCidade;
import View.Listagem.ListagemGrupo;
import View.Listagem.ListagemProduto;
import javax.swing.JFrame;


/**
 *
 * @author Craveiro
 */
public class PrincipalView extends javax.swing.JFrame {

    /**
     * Creates new form JFPrincipal
     */
    public PrincipalView() {
        initComponents();
        setExtendedState(MAXIMIZED_BOTH);
        setTitle("SisVader - Menu Principal");
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jSeparator2 = new javax.swing.JSeparator();
        jPanel2 = new javax.swing.JPanel();
        jMBPrincipal = new javax.swing.JMenuBar();
        jMCadastro = new javax.swing.JMenu();
        jMICidade = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JPopupMenu.Separator();
        jMIGrupo = new javax.swing.JMenuItem();
        jMIProduto = new javax.swing.JMenuItem();
        jSeparator3 = new javax.swing.JPopupMenu.Separator();
        jMICliente = new javax.swing.JMenuItem();
        jMAdministrativo = new javax.swing.JMenu();
        jMICadastrarUsuario = new javax.swing.JMenuItem();
        jMSair = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 808, Short.MAX_VALUE)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 23, Short.MAX_VALUE)
        );

        jMBPrincipal.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
                jMBPrincipalAncestorRemoved(evt);
            }
        });

        jMCadastro.setMnemonic('C');
        jMCadastro.setText("Manutenção");

        jMICidade.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I, java.awt.event.InputEvent.CTRL_MASK));
        jMICidade.setMnemonic('i');
        jMICidade.setText("Cidade");
        jMICidade.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMICidadeActionPerformed(evt);
            }
        });
        jMCadastro.add(jMICidade);
        jMCadastro.add(jSeparator1);

        jMIGrupo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G, java.awt.event.InputEvent.CTRL_MASK));
        jMIGrupo.setMnemonic('g');
        jMIGrupo.setText("Grupo");
        jMIGrupo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIGrupoActionPerformed(evt);
            }
        });
        jMCadastro.add(jMIGrupo);

        jMIProduto.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK));
        jMIProduto.setMnemonic('p');
        jMIProduto.setText("Produto");
        jMIProduto.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMIProdutoActionPerformed(evt);
            }
        });
        jMCadastro.add(jMIProduto);
        jMCadastro.add(jSeparator3);

        jMICliente.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK));
        jMICliente.setMnemonic('c');
        jMICliente.setText("Cliente");
        jMCadastro.add(jMICliente);

        jMBPrincipal.add(jMCadastro);

        jMAdministrativo.setText("Administrativo");

        jMICadastrarUsuario.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK));
        jMICadastrarUsuario.setText("Usuarios");
        jMICadastrarUsuario.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMICadastrarUsuarioActionPerformed(evt);
            }
        });
        jMAdministrativo.add(jMICadastrarUsuario);

        jMBPrincipal.add(jMAdministrativo);

        jMSair.setText("Sair");
        jMSair.setName("");
        jMSair.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMSairMouseClicked(evt);
            }
        });
        jMSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMSairActionPerformed(evt);
            }
        });
        jMSair.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                jMSairKeyPressed(evt);
            }
        });
        jMBPrincipal.add(jMSair);

        setJMenuBar(jMBPrincipal);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(567, Short.MAX_VALUE)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-816)/2, (screenSize.height-638)/2, 816, 638);
    }// </editor-fold>//GEN-END:initComponents

    private void jMIProdutoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIProdutoActionPerformed
        new ListagemProduto().setVisible(true);
    }//GEN-LAST:event_jMIProdutoActionPerformed

    private void jMBPrincipalAncestorRemoved(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_jMBPrincipalAncestorRemoved
        // TODO add your handling code here:
    }//GEN-LAST:event_jMBPrincipalAncestorRemoved

    private void jMSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMSairActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMSairActionPerformed

    private void jMSairMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMSairMouseClicked
        System.exit(0);
    }//GEN-LAST:event_jMSairMouseClicked

    private void jMSairKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jMSairKeyPressed
        // TODO add your handling code here:
    }//GEN-LAST:event_jMSairKeyPressed

    private void jMICadastrarUsuarioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMICadastrarUsuarioActionPerformed
        new ListagemUsuario().setVisible(true);      
    }//GEN-LAST:event_jMICadastrarUsuarioActionPerformed

    private void jMICidadeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMICidadeActionPerformed
        new ListagemCidade().setVisible(true);
    }//GEN-LAST:event_jMICidadeActionPerformed

    private void jMIGrupoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMIGrupoActionPerformed
        new ListagemGrupo().setVisible(true);
    }//GEN-LAST:event_jMIGrupoActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(PrincipalView.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new PrincipalView().setVisible(true);   
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu jMAdministrativo;
    private javax.swing.JMenuBar jMBPrincipal;
    private javax.swing.JMenu jMCadastro;
    private javax.swing.JMenuItem jMICadastrarUsuario;
    private javax.swing.JMenuItem jMICidade;
    private javax.swing.JMenuItem jMICliente;
    private javax.swing.JMenuItem jMIGrupo;
    private javax.swing.JMenuItem jMIProduto;
    private javax.swing.JMenu jMSair;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPopupMenu.Separator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JPopupMenu.Separator jSeparator3;
    // End of variables declaration//GEN-END:variables
}
